package com.baidu.day02;

public class Demo02 {
    public static void main(String[] args) {
        int result = printEnd(10);
        System.out.println(result);
    }

    public static int printEnd(int a) {
        if (a == 1) {
            return 1;
        } else {
            return a + printEnd(a - 1);
        }
    }
}
